The objective of this proposal is to understand the nature of ongoing cortical activity, what it represents, and how it interacts with external stimuli to generate a "real-time" response in primary visual cortex. We propose to use micro-machined electrode arrays to simultaneously record local-field potentials and single-unit activity, in combination with novel methods of mathematical analysis, to perform the following studies: (a) to measure and mathematically model the dynamics of cortical activity, in spontaneous and stimulus evoked regimes. We will test the hypothesis that cortical activity is structured and can be represented in a low-dimensional space. Novel mathematical models will be developed that predict population responses on a trial-to-trial basis. (b) To determine how populations of neurons represent distributions of physical attributes (such as orientation) within a local area of the visual field. We will test the hypothesis that dynamic switching among cortical states is involved in the representation of orientation distributions. (c) To measure, and mathematically model, the response of the cortical population to electrical stimulation through individual or groups of electrodes. The resulting model will be used in the design of a real-time controller of cortical activity. Given a pattern of cortical activity as a "target", we will test our ability to bring the population response into the target pattern via electrical stimulation. We will develop safe stimulation protocols by constraining the spatio-temporal pattern of electrical stimulation across the electrode array. The significance of the proposed work is its contribution to understanding the cortex as a "real-time" processing device. The findings will reveal how ongoing activity is structured, and how it combines with incoming visual stimulation to generate a response on a trial-by-trial basis. We will advance our basic knowledge of cortical function by investigating how neural populations represent distributions of physical attributes within a local region of the visual field. Finally, the techniques and methods developed here will be instrumental in the design of cortical prostheses for the restoration of sensory function, which require the activity of a large population of neurons to be controlled using a limited number of stimulating electrodes.